package com.bingbing.back.controller;

import com.bingbing.back.po.SchoolRecruitInfo;
import com.bingbing.back.service.SchoolRecruitInfoService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/recruitInfo")
public class SchoolRecruitInfoController {
    @Resource
    private SchoolRecruitInfoService schoolRecruitInfoService;

    /**
     * 根据学校id返回招生简章标题
     * @param schoolId
     * @return 其中包含infoId代表资讯id
     */
    @RequestMapping("/showTitle")
    public List<SchoolRecruitInfo> showTitle(int schoolId){
        return schoolRecruitInfoService.showTitle(schoolId);
    }

    /**
     * 根据资讯id返回招生简章内容
     * @param infoId 资讯id
     * @return
     */
    @RequestMapping("/showContentByInfoId")
    public List<String> showContentByInfoId(int infoId){
        return schoolRecruitInfoService.showContentByInfoId(infoId);
    }
}
